import { Key } from 'react'

export interface KfBaseTreeNode {
  id: Key
  name?: string
  children?: Partial<KfBaseTreeNode>[]
  parentsId?: Key[]
  parentsName?: string[]
}

export interface KfTreeNode extends Partial<KfBaseTreeNode> {
  key?: string
  value: string | number
  title?: any
  /**
   * label和title是一个意思, 如果2个属性都有值, 优先这个
   */
  label?: any
  disabled?: boolean
  children?: KfTreeNode[]
  isLeaf?: boolean
  checkable?: boolean
  disableCheckbox?: boolean

  [t: string]: any
}

export interface TreeUtilConfig {
  idProp?: string
  nameProp?: string
  levelProp?: string
  parentIdProp?: string
  parentsIdProp?: string
  parentsNameProp?: string
  childrenProp?: string
}
